/* AbstractTextViewer.java
 * Base class for the Form that displays big chunks of text for the user to
 * read.
 * 
 * © 2007 David Given.
 *
 * $Id: AbstractTextViewer.java 4 2007-06-25 15:26:37Z david.given $
 */

package com.cowlark.cowcalc;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;

public abstract class AbstractTextViewer extends Form implements CommandListener
{
	Command exitCommand = new Command("Back", Command.BACK, 0);

	AbstractTextViewer(String name)
	{
		super(name);
		addCommand(exitCommand);
		setCommandListener(this);
		
		populate();
	}

	public void commandAction(Command c, Displayable d)
    {
		if (c == exitCommand)
			Main.getInstance().setDisplayable(null);
    }
	
	abstract void populate();
}
